// 基于template/src/widgets/\{{appEntities}}/\{{ctrls@PORTLET}}-portlet/\{{spinalCase ctrl.codeName}}-menu-model.ts.hbs生成
{{#* inline 'getPortletAction' portlet}}
[
            {{#each portlet.psUIActionGroup.psUIActionGroupDetails as | a |}}
            {
                name: "{{a.name}}",
                caption: "{{a.psUIAction.caption}}",
                showIcon: {{a.showIcon}},
                showCaption: {{a.showCaption}},
                separator: {{a.addSeparator}},
                uIActionTag: "{{a.psUIAction.uIActionTag}}",
                noPrivDisplayMode: {{a.psUIAction.noPrivDisplayMode}},
                dataAccessAction: '{{a.psUIAction.dataAccessAction}}',
                actionTarget: '{{a.psUIAction.actionTarget}}',
                uIActionMode: "{{a.psUIAction.uIActionMode}}",
                disabled: false,
                visible: true,
                {{#if portlet.psAppViewLogics}}
                    {{#each portlet.psAppViewLogics as | logic |}}
                        {{#eq logic.name (concat portlet.name '_' a.name '_click')}}
                logic: {
                    name: '{{logic.name}}',
                    actionTag: '{{#if a.psUIAction}}{{a.psUIAction.uIActionTag}}{{/if}}',
                    xDataCtrlName: '{{portlet.name}}',
                    {{#and a.psUIAction a.psUIAction.psAppDataEntity}}
                    actionDECodeName: '{{a.psUIAction.psAppDataEntity.codeName}}',
                    {{/and}}
                    predefinedType: '{{#if a.psUIAction.psUIAction}}{{a.psUIAction.predefinedType}}{{/if}}'
                },
                        {{/eq}}
                    {{/each}}
                {{/if}}
                {{#if a.psUIAction.psSysImage}}
                    {{#if a.psUIAction.psSysImage.imagePath}}
                imgPath: "{{a.psUIAction.psSysImage.imagePath}}",
                    {{/if}}
                    {{#if a.psUIAction.psSysImage.cssClass}}
                iconClass: "{{a.psUIAction.psSysImage.cssClass}}",
                    {{/if}}
                {{/if}}
            },
        {{/each}}
        ],
{{/inline}}

function getConfig() {
    return {
        cssName: "{{#if ctrl.psSysCss}}{{ctrl.psSysCss.cssName}}{{/if}}",             
        caption: '{{ctrl.caption}}',
        codeName: '{{ctrl.codeName}}',
        controlType: '{{ctrl.controlType}}',
        name: '{{ctrl.name}}',
        {{#if (eq ctrl.portletType 'CONTAINER')}}
        portletArray:[
        {{#each ctrl.psControls as | portlet |}}
        {{> @macro/widgets/dashboard/portlet-model.hbs item=portlet}}
        {{/each}}
        ],        
        {{else}}
        actions: {{> getPortletAction portlet=ctrl}}
        {{/if}}
        portletType: '{{ctrl.portletType}}',
        {{#ctrl.psControls}}
            {{#eq controlType 'TOOLBAR'}}
        toolbarItems: [
            {{> @macro/widgets/toolbar/toolbar-item.hbs items=psDEToolbarItems view=ctrl toolbar=this}}
        ],
            {{/eq}}
        {{/ctrl.psControls}}
    }
}

export const model = getConfig()